<template>
  <div class="edit-form-box">
    <el-form
      :label-width="editFormConfig.labelWidth"
      :model="editFormData"
      :rules="editFormConfig.rules"
      :validate-on-rule-change="false"
      ref="editFormData"
    >
      <el-row style="display: flex; flex-wrap: wrap">
        <el-col
          :class="{ disShow: item.isHide, disVisibility: item.isVisibility }"
          :span="item.span || 8"
          :offset="item.offset || 0"
          v-for="(item, index) in editFormConfig.itemArr"
          :key="index"
        >
          <div class="otherInfoDiv" v-if="item.otherInfo">
            <slot
              :name="item.prop"
              :item="item"
              :editFormInfo="editFormData"
              v-if="item.otherInfo"
            ></slot>
          </div>
          <el-form-item
            :label="item.label"
            :prop="item.propArr || item.prop"
            :title="item.title || item.label"
            :class="{
              h40: ![
                'upload',
                'textarea',
                'dept-select',
                'user-select',
                'location-select',
              ].includes(item.type),
              changeData:
                showChange &&
                isEqual(
                  oldFormData[item.propArr || item.prop],
                  editFormData[item.propArr || item.prop],
                  item
                ),
            }"
            class="special"
            v-if="!item.isHide && !item.otherInfo"
          >
            <slot :name="item.prop" :item="item" :editFormInfo="editFormData">
              <el-input-number
                size="mini"
                v-model="editFormData[item.prop]"
                v-if="item.type === 'el-number'"
                :precision="item.precision"
                :step="item.step"
                :max="item.max"
                :min="item.min"
                :step-strictly="item.stepStrictly"
                :disabled="item.disabled"
                controls-position="right"
                :controls="item.controls || true"
                :placeholder="item.placeholder || '请输入'"
                @change="(val) => inputChange(val, item)"
                class="w100"
              ></el-input-number>
              <el-input
                size="mini"
                v-model="editFormData[item.prop]"
                v-else-if="item.type === 'money'"
                :disabled="item.disabled"
                :placeholder="item.placeholder || '请输入'"
                @change="(val) => inputChange(val, item)"
                class="w100"
                thousand-formatter
              ></el-input>
              <el-input
                class="w100"
                v-else-if="item.type === 'icon-button'"
                size="mini"
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                :disabled="item.disabled"
              >
                <i
                  slot="append"
                  style="font-size: 24px; color: #0d60b4"
                  :class="item.icon || 'el-icon-remove-outline'"
                  @click="
                    item.methods ? item.methods(item, editFormData) : null
                  "
                ></i>
              </el-input>
              <el-input
                class="w100"
                v-else-if="item.type === 'input-button'"
                size="mini"
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                :disabled="item.disabled"
              >
                <el-button
                  slot="append"
                  class="input-button-type"
                  @click="item.method ? item.method(item, editFormData) : null"
                  >复制路径</el-button
                >
              </el-input>
              <el-input
                class="w100"
                v-else-if="item.type === 'sign'"
                size="mini"
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                disabled="true"
                readonly
              >
                <el-button
                  slot="append"
                  v-if="!item.signed"
                  :disabled="true"
                  class="signed"
                  >已签名</el-button
                >
                <el-button slot="append" v-else :disabled="true" class="sign"
                  >未签名</el-button
                >
              </el-input>
              <!-- 带搜索的单选多选下拉框---岗位选择 -->
              <!-- 1、回选显示一个，其他用个数表示 -->
              <el-select
                v-model="editFormData[item.prop]"
                v-else-if="item.type === 'select-search' && item.collapseTags"
                :disabled="item.disabled"
                :readonly="item.readonly"
                :filterable="item.filterable ? item.filterable : true"
                :clearable="item.clearable"
                :size="item.size ? item.size : 'mini'"
                class="w100"
                :multiple="item.multiple"
                :multiple-limit="item.multipleLimit ? item.multipleLimit : 0"
                @change="(val) => searchSelectChange(val, item)"
                :placeholder="item.placeholder || '请选择'"
              >
                <template v-for="item_s in item.seleteOption">
                  <el-option
                    v-if="typeof editFormData[item.prop] == 'string'"
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="'' + item_s.value"
                  ></el-option>
                  <el-option
                    v-else-if="typeof editFormData[item.prop] == 'number'"
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="
                      ('' + item_s.value).trim() == ''
                        ? ''
                        : parseInt(item_s.value)
                    "
                  ></el-option>
                  <el-option
                    v-else
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="item_s.value"
                  ></el-option>
                </template>
              </el-select>
              <!-- 1、回选显示全部 -->
              <el-select
                v-model="editFormData[item.prop]"
                v-else-if="item.type === 'select-search' && !item.collapseTags"
                :disabled="item.disabled"
                :readonly="item.readonly"
                :filterable="item.filterable ? item.filterable : true"
                :clearable="item.clearable"
                :size="item.size ? item.size : 'mini'"
                class="w100"
                :multiple="item.multiple"
                :multiple-limit="item.multipleLimit ? item.multipleLimit : 0"
                collapse-tags
                @change="(val) => searchSelectChange(val, item)"
                :placeholder="item.placeholder || '请选择'"
              >
                <template v-for="item_s in item.seleteOption">
                  <el-option
                    v-if="typeof editFormData[item.prop] == 'string'"
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="'' + item_s.value"
                  ></el-option>
                  <el-option
                    v-else-if="typeof editFormData[item.prop] == 'number'"
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="
                      ('' + item_s.value).trim() == ''
                        ? ''
                        : parseInt(item_s.value)
                    "
                  ></el-option>
                  <el-option
                    v-else
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="item_s.value"
                  ></el-option>
                </template>
              </el-select>
              <el-select
                v-model="editFormData[item.prop]"
                v-else-if="item.type === 'select'"
                :disabled="item.disabled"
                :readonly="item.readonly"
                :filterable="item.filterable"
                :clearable="!item.required || item.clearable"
                size="mini"
                :class="{ w100: true, textRed: item.red }"
                :multiple="item.multiple"
                default-first-option
                :allow-create="item.allowCreate"
                :title="
                  getSelectTitle(item.selectOption, editFormData[item.prop])
                "
                @change="(val) => selectChange(val, item)"
                :remote-method="
                  (query) => {
                    getSelectOption(query, item);
                  }
                "
                @visible-change="
                  (val) => (item.visibleChange ? item.visibleChange(val) : null)
                "
                :placeholder="item.placeholder || '请选择'"
              >
                <template v-for="item_s in item.selectOption">
                  <el-option
                    v-if="typeof editFormData[item.prop] == 'string'"
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="'' + item_s.value"
                    :title="null"
                    :disabled="
                      item.disabledOp
                        ? item.disabledOp(item_s.value, item.selectOption)
                        : null
                    "
                  ></el-option>
                  <el-option
                    v-else-if="typeof editFormData[item.prop] == 'number'"
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="
                      ('' + item_s.value).trim() == ''
                        ? ''
                        : parseInt(item_s.value)
                    "
                    :disabled="
                      item.disabledOp
                        ? item.disabledOp(item_s.value, item.selectOption)
                        : null
                    "
                  ></el-option>
                  <el-option
                    v-else
                    :key="item_s.value"
                    :label="item_s.label"
                    :value="item_s.value"
                    :disabled="
                      item.disabledOp
                        ? item.disabledOp(item_s.value, item.selectOption)
                        : null
                    "
                  ></el-option>
                </template>
              </el-select>
              <el-date-picker
                v-else-if="
                  [
                    'date',
                    'week',
                    'month',
                    'year',
                    'datetime',
                    'daterange',
                    'datetimerange',
                  ].includes(item.type)
                "
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                class="w100"
                :type="item.type"
                size="mini"
                @change="(val) => inputChange(val, item)"
                :placeholder="item.placeholder || '选择日期'"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :disabled="item.disabled"
                :picker-options="item.pickerOptions"
                :readonly="item.readonly"
                :clearable="item.clearable"
                :unlink-panels="true"
                :format="item.dateFormat || dateFrm(item.type)"
                :value-format="item.dateFormat || dateFrm(item.type)"
              ></el-date-picker>
              <el-time-picker
                :is-range="item.type === 'timerange'"
                v-else-if="['time', 'timerange'].includes(item.type)"
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                size="mini"
                class="w100"
                @change="(val) => inputChange(val, item)"
                range-separator="至"
                start-placeholder="开始时间"
                end-placeholder="结束时间"
                :placeholder="item.placeholder || '选择时间'"
                :picker-options="item.pickerOptions"
                :value-format="item.valueFormat"
                :format="item.valueFormat"
                :disabled="item.disabled"
                :readonly="item.readonly"
                :clearable="item.clearable"
              ></el-time-picker>
              <el-time-select
                v-else-if="item.type == 'timeSelect'"
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                size="mini"
                class="w100"
                @change="(val) => inputChange(val, item)"
                :placeholder="item.placeholder || '选择时间'"
                :picker-options="item.pickerOptions"
                :disabled="item.disabled"
                :readonly="item.readonly"
                :clearable="item.clearable"
              ></el-time-select>
              <!-- 区块联动 -->
              <el-cascader
                v-model="editFormData[item.prop]"
                v-else-if="
                  [
                    'provinceAndCity',
                    'provinceAndCityPlus',
                    'regionSelect',
                    'regionSelectPlus',
                    'el-cascader',
                  ].includes(item.type)
                "
                :disabled="item.disabled"
                :readonly="item.readonly"
                :separator="item.separator"
                :filterable="item.filterable"
                :clearable="item.clearable"
                :title="editFormData[item.prop]"
                size="mini"
                class="w100"
                :options="cascaderOp[item.type] || item.selectOption"
                @change="(val) => selectCascaderChange(val, item)"
                :placeholder="item.placeholder || '请选择'"
              ></el-cascader>

              <template v-else-if="item.type == 'upload'">
                <el-checkbox-group
                  v-model="editFormData[item.prop]"
                ></el-checkbox-group>
                <attach-form
                  :filesList="editFormData[item.prop]"
                  class="w100"
                  :disabled="item.disabled || item.readonly"
                  :accept="item.accept"
                  :limit="item.limit"
                  :title="item.title"
                  :multiple="item.multiple"
                  :rules="item.rules || null"
                  @changeFilesField="
                    (filesObj) => changeFilesField(filesObj, item)
                  "
                ></attach-form>
              </template>

              <el-input
                v-else-if="
                  [
                    'user-realNameMember',
                    'user-pdMember',
                    'dept-orgAuth',
                    'dept-pdOrg',
                    'majorEquipment',
                  ].includes(item.type)
                "
                size="mini"
                @change="(val) => inputChange(val, item)"
                :fetch-suggestions="querySearchAsync(item)"
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                :disabled="item.disabled"
                readonly
              >
                <el-button
                  slot="append"
                  :icon="
                    item.type == 'majorEquipment'
                      ? 'el-icon-s-tools'
                      : ['user', 'user-pdMember'].includes(item.type)
                      ? 'el-icon-user'
                      : 'el-icon-location'
                  "
                  :disabled="item.disabled || item.readonly"
                  @click="goSeleteOrgMember(item, item.type)"
                ></el-button>
              </el-input>
              <el-input
                v-else-if="
                  ['user', 'dept', 'location', 'unifyUser'].includes(item.type)
                "
                size="mini"
                @change="(val) => inputChange(val, item)"
                :fetch-suggestions="querySearchAsync(item)"
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                :disabled="item.disabled"
                @click.native="
                  item.customType === 'entireTrigger'
                    ? goSelectUser(item, item.type)
                    : () => {}
                "
                readonly
              >
                <el-button
                  slot="append"
                  :icon="
                    ['user'].includes(item.type)
                      ? 'el-icon-user'
                      : 'el-icon-location'
                  "
                  :disabled="item.disabled || item.readonly"
                  @click="goSelectUser(item, item.type)"
                ></el-button>
              </el-input>
              <el-input
                v-else-if="
                  [
                    'userMultiple',
                    'userMultiple-pdMember',
                    'deptMultiple',
                    'deptMultiple-pdOrg',
                    'locationMultiple',
                  ].includes(item.type)
                "
                size="mini"
                type="textarea"
                rows="2"
                :maxlength="item.maxlength"
                v-model="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                :title="editFormData[item.prop]"
                @click.native="goSeleteOrgMember(item, item.type)"
                @change="(val) => inputChange(val, item)"
                :disabled="item.disabled"
                readonly
                class="w100"
              ></el-input>

              <span
                class="selectDiv"
                v-else-if="
                  [
                    'dept-select',
                    'user-select',
                    'location-select',
                    'device-select',
                    'userOnly-select',
                  ].includes(item.type)
                "
                :class="{ multipleDiv: item.multiple }"
              >
                <span class="selectContent" :class="'line' + item.rows">
                  <el-select
                    ref="selectItem"
                    size="mini"
                    filterable
                    clearable
                    remote
                    reserve-keyword
                    default-first-option
                    v-model="editFormData[item.propArr]"
                    :disabled="item.disabled"
                    :multiple="item.multiple"
                    :multiple-limit="item.multipleNum || 0"
                    :loading="selectLoading"
                    :placeholder="item.placeholder || '请选择'"
                    :remote-method="
                      (query) => {
                        getSelectOption(query, item);
                      }
                    "
                    @change="(val) => selectChange(val, item)"
                    @clear="orgComClear(item)"
                    @visible-change="(val) => clearOther(val, item)"
                    @remove-tag="(val) => removeTag(val, item)"
                    @focus="(val) => selectFocus(val, item)"
                    v-loadmore="(val) => equipmentLoad(item)"
                    :title="editFormData[item.prop]"
                    popper-class="userSelect"
                  >
                    <el-option
                      v-for="(optionItem, index) in item.option"
                      :key="index"
                      :label="optionItem.label + ' ' + outOrgSign(optionItem)"
                      :value="optionItem.value"
                    >
                      <div class="itemConten">
                        <div class="itemConten-item itemConten-top">
                          <span style="float: left">
                            {{ optionItem.label }}
                            {{ outOrgSign(optionItem) }}
                          </span>
                          <span
                            style="
                              float: right;
                              color: #979797;
                              font-size: 13px;
                            "
                            v-if="item.type == 'user-select'"
                            >{{ optionItem.orgName }}</span
                          >
                        </div>
                        <div class="itemConten-item itemConten-bottom">
                          <span class="pathName">
                            {{ optionItem.levelPathName }}
                            {{ optionItem.fullPathName }}
                          </span>
                        </div>
                      </div>
                    </el-option>
                  </el-select>
                  <el-button
                    class="selectBtn"
                    slot="append"
                    :icon="
                      ['user-select', 'userOnly-select'].includes(item.type)
                        ? 'icon-a-xuanzerenyuanduo'
                        : 'el-icon-location'
                    "
                    :disabled="item.disabled || item.readonly"
                    @click="goSelectUser(item, item.type)"
                  ></el-button>
                  <el-button
                    class="selectBtn"
                    size="mini"
                    v-if="item.moreBtn || false"
                    icon="el-icon-more"
                    @click="item.moreBtnMethod(editFormData)"
                  ></el-button>
                </span>
              </span>
              <el-autocomplete
                v-else-if="item.type == 'autocomplete'"
                v-model="editFormData[item.prop]"
                :fetch-suggestions="querySearchAsync(item)"
                class="w100"
                size="mini"
                :placeholder="item.placeholder || '请选择'"
                :title="editFormData[item.prop]"
                @select="(obj) => handleSelectAuto(obj, item)"
                @input="(val) => changeAuto(val, item)"
                :disabled="item.disabled"
                :clearable="item.clearable"
              ></el-autocomplete>
              <el-radio-group
                :class="{ w100: true, textRed: item.red }"
                size="mini"
                :key="index"
                v-model="editFormData[item.prop]"
                @change="(val) => radioChange(val, item)"
                v-else-if="item.type == 'radio'"
              >
                <el-radio
                  v-for="(item_s, index) in item.radioOption"
                  :key="index"
                  :label="item_s.value"
                  :disabled="
                    item.disabled || editFormData.controlMeasures == '4'
                  "
                >
                  {{ item_s.label }}
                  <span v-show="editFormConfig.showRadioBtn">
                    <el-button
                      v-for="(item_c, index) in item_s.radioBtn"
                      :key="index"
                      @click="item_c.method ? item_c.method() : null"
                      type="primary"
                      size="small"
                      >{{ item_c.label }}</el-button
                    >
                  </span>
                </el-radio>
              </el-radio-group>
              <!--设备分类-->
              <el-input
                v-else-if="item.type == 'deviceClassify'"
                size="mini"
                :class="{ disabledInputGroup: item.disabled }"
                :title="editFormData[item.prop]"
                v-model="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                readonly
                :disabled="item.disabled"
              >
                <el-button
                  style="font-size: 16px"
                  slot="append"
                  icon="el-icon-setting"
                  :disabled="item.disabled"
                  @click="goSelectUser(item, 'deviceClassify')"
                ></el-button>
              </el-input>
              <!-- 工器具父节点 -->
              <el-input
                v-else-if="item.type == 'toolOrg' || item.type == 'toolOrg_dep'"
                size="mini"
                :class="{ disabledInputGroup: item.disabled }"
                :title="editFormData[item.prop]"
                v-model="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                readonly
                :disabled="item.disabled"
              >
                <el-button
                  style="font-size: 16px"
                  slot="append"
                  icon="el-icon-setting"
                  :disabled="item.disabled"
                  @click="goSelectUser(item, item.type)"
                ></el-button>
              </el-input>
              <!--新增设备-->
              <el-input
                v-else-if="item.type == 'device'"
                size="mini"
                :class="{ disabledInputGroup: item.disabled }"
                :title="editFormData[item.prop]"
                v-model="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                :disabled="item.disabled"
                readonly
              >
                <template slot="append">
                  <el-button
                    style="font-size: 16px"
                    icon="el-icon-setting"
                    :disabled="item.disabled"
                    @click="goSelectUser(item, 'device')"
                  ></el-button>
                </template>
              </el-input>
              <!--新增高压线-->
              <el-input
                v-else-if="item.type == 'line'"
                size="mini"
                :class="{ disabledInputGroup: item.disabled }"
                :title="editFormData[item.prop]"
                v-model="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                :disabled="item.disabled"
                readonly
              >
                <template slot="append">
                  <el-button
                    style="font-size: 16px"
                    icon="el-icon-setting"
                    :disabled="item.disabled"
                    @click="goSelectUser(item, 'line')"
                  ></el-button>
                </template>
              </el-input>
              <!--选择风险点-->
              <el-input
                v-else-if="item.type == 'risk'"
                size="mini"
                :class="{ disabledInputGroup: item.disabled }"
                :title="editFormData[item.prop]"
                v-model="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                :disabled="item.disabled"
                readonly
              >
                <template slot="append">
                  <el-button
                    style="font-size: 16px"
                    icon="el-icon-setting"
                    :disabled="item.disabled"
                    @click="goSelectUser(item, 'risk')"
                  ></el-button>
                </template>
              </el-input>
              <!--选择工作票-->
              <el-input
                v-else-if="item.type == 'workTicket'"
                size="mini"
                :class="{ disabledInputGroup: item.disabled }"
                v-model="editFormData[item.prop]"
                :title="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                :disabled="item.disabled"
                readonly
              >
                <el-button
                  slot="append"
                  icon="el-icon-s-ticket"
                  :disabled="item.disabled || item.readonly"
                  @click="getListDialogItem(item, item.type)"
                ></el-button>
              </el-input>
              <!-- 选择设备品牌库 -->
              <el-select
                v-else-if="item.type == 'equipmentBrand'"
                ref="selectItem"
                size="mini"
                filterable
                clearable
                remote
                default-first-option
                class="w100"
                v-model="editFormData[item.propArr]"
                :disabled="item.disabled"
                :multiple="false"
                :placeholder="item.placeholder || '请选择'"
                :remote-method="
                  (query) => {
                    getEquipmentBrand(query, item);
                  }
                "
                @change="(val) => brandSelectChange(val, item)"
                @clear="orgComClear(item)"
                @visible-change="(val) => clearOther(val, item)"
                v-loadmore="(val) => load(item)"
              >
                <el-option
                  v-for="(optionItem, index) in item.option"
                  :key="index"
                  :label="optionItem.label + ' ' + brandSign(optionItem)"
                  :value="optionItem.value"
                >
                  <div>
                    <span>
                      {{ `${optionItem.label}${brandSign(optionItem)}` }}
                    </span>
                  </div>
                </el-option>
              </el-select>
              <!-- 选择缺陷关键字 -->

              <el-input
                v-else-if="item.type == 'defectKeyWord'"
                size="mini"
                :class="{ disabledInputGroup: item.disabled }"
                :title="editFormData[item.prop]"
                v-model="editFormData[item.prop]"
                :placeholder="item.placeholder || '请选择'"
                :disabled="item.disabled"
                readonly
              >
                <el-button
                  class="selectBtn"
                  slot="append"
                  :disabled="item.disabled || item.readonly"
                  @click="getListDialogItem(item, item.type)"
                  >选择</el-button
                >
              </el-input>

              <!-- 选择车辆或司机 -->
              <span
                class="selectDiv"
                v-else-if="
                  ['driver', 'vehicle', 'apply-code'].includes(item.type)
                "
              >
                <span class="selectContent" :class="'line' + item.rows">
                  <!-- <el-select
                    ref="selectItem"
                    size="mini"
                    filterable
                    :clearable="!item.required || item.clearable"
                    remote
                    reserve-keyword
                    default-first-option
                    v-model="editFormData[item.prop]"
                    :disabled="item.disabled"
                    :multiple="false"
                    :loading="selectLoading"
                    :placeholder="item.placeholder || '请选择'"
                    :remote-method="
                      (query) => {
                        getDefectList(query, item);
                      }
                    "
                    @change="(val) => defectSelectChange(val, item)"
                    @clear="orgComClear(item)"
                    @visible-change="(val) => clearOther(val, item)"
                    popper-class="userSelect"
                  >
                    <el-option
                      v-for="(optionItem, index) in item.option"
                      :key="index"
                      :label="optionItem.label"
                      :value="optionItem.value"
                    >
                      <div>
                        <span>{{ defectSign(optionItem) }}</span>
                      </div>
                    </el-option>
                  </el-select>-->
                  <el-input
                    size="mini"
                    :class="{ disabledInputGroup: item.disabled }"
                    :title="editFormData[item.prop]"
                    v-model="editFormData[item.prop]"
                    :placeholder="item.placeholder || '请选择'"
                    :disabled="item.disabled"
                    :readonly="item.readonly || false"
                  ></el-input>
                  <el-button
                    class="selectBtn"
                    slot="append"
                    :icon="item.icon || icon - cheliangguanli"
                    :disabled="item.disabled || !item.readonly"
                    @click="getListDialogItem(item, item.type)"
                  ></el-button>
                </span>
              </span>
              <!-- 位置定位 -->
              <div class="dayInput" v-else-if="item.type == 'fixedPosition'">
                <el-input
                  :title="editFormData[item.prop]"
                  v-model="editFormData[item.prop]"
                  size="mini"
                  :disabled="item.disabled"
                ></el-input>
                <span
                  class="el-icon-map-location location"
                  @click="openMap"
                ></span>
              </div>
              <div v-else-if="item.type == 'none'"></div>
              <el-input
                v-else
                size="mini"
                :autosize="item.autosize || false"
                :type="item.type || ''"
                :rows="item.rows || 1"
                v-model="editFormData[item.prop]"
                :placeholder="item.placeholder || ''"
                :title="editFormData[item.prop]"
                @change="(val) => inputChange(val, item)"
                :disabled="item.disabled"
                v-focus="item.autofocus"
                :readonly="item.readonly"
                :clearable="item.clearable"
                :maxlength="item.maxlength"
                show-word-limit
                :class="{ w100: true, textRed: item.red }"
                @focus="
                  item.focusMethod ? item.focusMethod(item, editFormData) : null
                "
                :autocomplete="item.autocomplete"
              >
                <span
                  slot="suffix"
                  v-if="item.suffixText"
                  style="cursor: pointer"
                  @click="item.linkMethod"
                  >{{ item.suffixText }}</span
                >
                <div v-if="item.hasInputAppend" slot="append">
                  <slot name="inputToolSlot"></slot>
                </div>
              </el-input>
              <slot :name="item.prop + '_popup'"></slot>
              <slot :name="item.prop + '_warningTips'"></slot>
            </slot>
          </el-form-item>
          <!-- 设备移动改前值提示 -->
          <div
            v-if="
              checkIsShowPreviousValue(item)
            "
            :style="`text-align:left;transform: translate(135px,-20px);width:200px;color:#f56c6c;`"
          >
            改前值：{{ getPreviousValue(item) }}
          </div>
        </el-col>
      </el-row>
    </el-form>
    <!--     <dialogPublic
      title="信息选择"
      :show.sync="showMember"
      @doSubmit="addSeleteMember"
      @doClose="() => (showMember = false)"
      width="60%"
      appendTobody
    >
      <orgMemberSelect
        ref="orgMemberSelect"
        v-if="showMember"
        :seleteSetting="orgMemberSelect"
        :otherInfo="otherInfo"
      ></orgMemberSelect>
    </dialogPublic>-->
    <dialogPublic
      title="地址"
      :show.sync="showLocation"
      width="60%"
      noFootBtn
      @doClose="() => (showLocation = false)"
    >
      <dialogMap
        v-if="showLocation"
        ref="dialogMap"
        :currentInfo="locationInfo"
      ></dialogMap>
    </dialogPublic>
    <dialogPublic
      title="信息选择"
      :show.sync="showUser"
      @doSubmit="newMemberSelect"
      @doClose="() => (showUser = false)"
      :fullscreen="true"
      appendTobody
    >
      <newMemberSelect
        ref="newMember"
        v-if="showUser"
        :seleteSetting="orgMemberSelect"
      ></newMemberSelect>
    </dialogPublic>
    <dialogPublic
      title="信息选择"
      :show.sync="showDevice"
      @doSubmit="newMemberSelect"
      @doClose="() => (showDevice = false)"
      :fullscreen="true"
      appendTobody
    >
      <equipmentSelect
        ref="newMember"
        v-if="showDevice"
        :seleteSetting="orgMemberSelect"
      ></equipmentSelect>
    </dialogPublic>
    <dialogPublic
      title="信息选择"
      :show.sync="showRisk"
      @doSubmit="newMemberSelect"
      @doClose="() => (showRisk = false)"
      :fullscreen="true"
      appendTobody
    >
      <riskPointSelect
        ref="newMember"
        v-if="showRisk"
        :seleteSetting="orgMemberSelect"
      ></riskPointSelect>
    </dialogPublic>

    <dialogPublic
      title="信息选择"
      :show.sync="showTool"
      @doSubmit="newMemberSelect"
      @doClose="() => (showTool = false)"
      :fullscreen="true"
      appendTobody
    >
      <toolOrgSelect
        ref="newMember"
        v-if="showTool"
        :seleteSetting="orgMemberSelect"
      ></toolOrgSelect>
    </dialogPublic>

    <dialogPublic
      :title="'信息选择'"
      :show.sync="showList"
      @doSubmit="setListDialogItem"
      @doClose="() => (showList = false)"
      width="90%"
    >
      <div style="height: 500px">
        <component
          :is="listContent"
          ref="listDialog"
          :selectId="selectId"
          v-if="showList"
        />
      </div>
    </dialogPublic>
    <dialogPublic
      :title="'选择主要设备'"
      height="600px"
      width="90%"
      :show.sync="showEquipment"
      @doSubmit="seleteEquipment"
      @doClose="() => (showEquipment = false)"
    >
      <majorEquipment
        v-if="showEquipment"
        ref="majorEquipment"
        :seleteSetting="majorEquipment"
      ></majorEquipment>
    </dialogPublic>
  </div>
</template>

<script>
/**引进省市区数据 */
import {
  provinceAndCityData,
  regionData,
  provinceAndCityDataPlus,
  regionDataPlus,
} from "element-china-area-data";
import workTicket from "@/views/twoTicketManagement/operationTicket/operationTicketProcessing/workList";
import defectLibrary from "@/views/standardManagement/defectLibrary/defectRelatePage";
import dialogMap from "./dialogMap.vue";
import {
  queryUserList, //查询用户
  getOrgList, //查询组织
  queryPostList, //查询岗位
} from "@/api/common";
import { getUserDataByOrg } from "@/api/systemManagement/userManagement.js";
import { queryList } from "@/api/equipmentLedger/equipmentManage";
import {
  brandStockList,
  brandStockAdd,
  brandStockNumPlus,
} from "@/api/standardManagement/equipmentBrand.js";
import {
  queryDefectList,
  saveDefect,
  DefectRefPlus,
} from "@/api/standardManagement/defectLibrary.js";
import { getlocationList } from "@/api/equipmentLedger/locationManage.js";
export default {
  components: {
    workTicket,
    defectLibrary,
    dialogMap,
  },
  props: {
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
    //用于比较数据是否发生变化
    oldFormData: {
      type: Object,
      default: () => {
        return {};
      },
    },
    showChange: {
      type: Boolean,
      default: false,
    },
    positiveSequence: {
      type: Boolean,
      default: false,
    },
    formConfig: {
      type: Object,
      default: () => {
        return {};
      },
    },
    otherInfo: {
      type: Object,
      default: () => {
        return {};
      },
    },
    // 设备异动优化相关
    customArr: {
      type: Object,
      default: () => {},
    },
    // 设备异动变更参数的列表
    parameterList: {
      type: Array,
      default: () => []
    },
    // 设备异动选中的设备节点
    parameterNode: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      showLocation: false,
      showList: false,
      showEquipment: false,
      showTool: false,
      showUser: false,
      showDevice: false,
      showRisk: false,
      showLine: false,
      listContent: null,
      listContentProp: "",
      dialogItem: null,
      locationInfo: {},
      editFormData: {},
      selectOption: [],
      selectId: [],
      editFormConfig: {
        labelWidth: "135px",
        rules: {},
        itemArr: [],
        showRadioBtn: "",
      },
      selectLoading: false,
      showMember: false,
      currentItem: {},
      orgMemberSelect: {},
      majorEquipment: {},
      cascaderOp: {
        provinceAndCity: provinceAndCityData,
        regionSelect: regionData,
        provinceAndCityPlus: provinceAndCityDataPlus,
        regionSelectPlus: regionDataPlus,
      },
      dialogType: "",
      query: "",
      count: 1,
    };
  },
  directives: {
    //注册一个局部的自定义指令 v-focus
    focus: {
      // 指令的定义
      inserted: function (el, binding) {
        if (binding.value) {
          // 聚焦元素
          el.querySelector("input").focus();
        }
      },
    },
  },
  created() {
    this.init();
  },
  watch: {
    formData: {
      handler(val) {
        this.editFormData = Object.assign({}, val);
      },
      deep: true,
    },
    formConfig: {
      handler(val) {
        this.editFormConfig = Object.assign({}, this.editFormConfig, val);
      },
      deep: true,
      immediate: false,
    },
  },
  mounted() {
    this.editFormData = Object.assign({}, this.formData);
  },
  methods: {
    init() {
      let rules = {};
      this.editFormConfig = Object.assign(
        {},
        this.editFormConfig,
        this.formConfig
      );
      this.formConfig.itemArr.map((i) => {
        if (i.required) {
          let message = "";
          if (
            i.type === "text" ||
            i.type === "textarea" ||
            i.type === "el-number" ||
            i.type === "password"
          ) {
            message = `请输入`;
          } else {
            message = `请选择`;
          }
          if (
            [
              "dept-select",
              "user-select",
              "location-select",
              "device-select",
              "device",
              "userOnly-select",
              "line",
            ].includes(i.type)
          ) {
            rules[i.propArr] = [];
            rules[i.propArr].push({
              required: true,
              message: message + i.label,
              trigger: i.trigger || "blur",
            });
          } else {
            rules[i.prop] = [];
            rules[i.prop].push({
              required: true,
              message: message + i.label,
              trigger: i.trigger || "blur",
            });
          }
        }
        if (i.rules && i.type != "upload") {
          rules[i.prop] = rules[i.prop] || [];
          rules[i.prop].push(i.rules);
        }
        if (i.ruleArr && i.type != "upload") {
          rules[i.prop] = [];
          rules[i.prop].push(...i.ruleArr);
        }
        //初始化选人选组织的数据类型
        if (
          [
            "dept-select",
            "user-select",
            "location-select",
            "userOnly-select",
          ].includes(i.type)
        ) {
          if (i.multiple) {
            //多选
            this.editFormData[i.propArr] = [];
          } else {
            this.editFormData[i.propArr] = "";
          }
        }
      });
      this.editFormData = Object.assign({}, this.formData);
      this.editFormConfig.rules = Object.assign({}, rules);
    },
    // 设备异动判断是否展示改前值
    checkIsShowPreviousValue(item) {
      let { status } = this.$route.query
      let flag
      if(status == null || status < 2) {
        flag = JSON.stringify(this.customArr) !== "{}" &&
          this.editFormConfig.customRules &&
          ((this.customArr[item.prop] &&
            this.customArr[item.prop].paramValue !== this.editFormData[item.prop]) ||
            (this.customArr[item.prop.replace("Id", "")] &&
              this.customArr[item.prop.replace("Id", "")].paramValue !==
                this.editFormData[item.prop.replace("Id", "")]));
      } else {
        let oldparam = this.parameterList.filter(i => i.equipId === this.parameterNode).find(i => i.paramId == item.prop)
        flag = JSON.stringify(this.customArr) !== "{}" &&
          this.editFormConfig.customRules &&
          ((this.customArr[item.prop] &&
            oldparam))
      }
      return flag
    },
    // 设备异动获取改前值
    getPreviousValue(item) {
      let { status } = this.$route.query
      if(status == null || status < 2) {
        return (this.customArr[item.prop] && this.customArr[item.prop].paramValue) ||
                (this.customArr[item.prop.replace("Id", "")] &&
                  this.customArr[item.prop.replace("Id", "")].paramValue) ||
                "-"
      } else {
        let oldparam = this.parameterList.filter(i => i.equipId === this.parameterNode).find(i => i.paramId == item.prop)
        return oldparam.paramOld || '-'
      }
    },
    // 设置校验规则
    setItemArrRules(rules) {
      this.editFormConfig.rules = Object.assign(
        {},
        this.editFormConfig.rules,
        rules
      );
    },
    getFormData(needValid = true) {
      return new Promise((resolve, reject) => {
        let data = Object.assign({}, this.editFormData);
        if (!needValid) {
          resolve(data);
          return;
        }
        this.$refs.editFormData.validate((valid) => {
          if (valid) {
            resolve(data);
          } else {
            reject("未填写完整");
          }
        });
      });
    },
    getCurrentData() {
      return this.editFormData;
    },
    //获取下拉框的title
    getSelectTitle(option, value) {
      let one = option.find((item) => item.value == value) || {};
      return one.label;
    },
    //日期数据处理
    dateFrm(type) {
      if (type === "date" || type === "daterange") {
        return "yyyy-MM-dd";
      } else if (type == "datetime" || type === "datetimerange") {
        return "yyyy-MM-dd HH:mm";
      } else if (type == "month") {
        return "yyyy-MM";
      } else if (type == "year") {
        return "yyyy";
      } else {
        return "";
      }
    },
    //判断前后值是否一致
    isEqual(oldVal, val, item) {
      if (item.multiple) {
        //多选
        let oldArr = oldVal || [];
        let arr = val || [];
        if (oldArr.length == arr.length) {
          let result = false;
          for (let i = 0; i < oldArr.length; i++) {
            if (!arr.includes(oldArr[i])) {
              result = true;
              break;
            }
          }
          return result;
        } else {
          return true;
        }
      } else {
        return oldVal != val;
      }
    },
    outOrgSign(data) {
      if (data.isOutOrg) {
        if (data.isOutOrg == "-1") {
          return "(临)";
        } else if (data.isOutOrg == "1") {
          return "(外)";
        } else if (data.isOutOrg == "0") {
          return "";
        }
      } else {
        return "";
      }
    },
    brandSign(data) {
      if (data.factoryName) {
        return `(${data.factoryName})`;
      } else {
        return "";
      }
    },
    defectSign(data) {
      if (data.others) {
        return `[${data.parentTypeName}]：${data.label}(${data.others})`;
      } else if (data.parentTypeId) {
        return `[${data.parentTypeName}]：${data.label}`;
      } else {
        return data.label;
      }
    },
    selectFocus(val, item) {
      let result = true;
      if (item.beforeMethod) {
        result = item.beforeMethod(this.editFormData, item);
      }
      if (!result) {
        this.$refs.selectItem[0].blur();
      }
    },
    //打开地图
    openMap() {
      let obj = {};
      this.editFormConfig.itemArr.forEach((item) => {
        if (item.label == "安装位置") {
          obj.address = this.editFormData[item.prop];
        } else if (item.label == "纬度") {
          obj.latitude = this.editFormData[item.prop];
        } else if (item.label == "经度") {
          obj.longitude = this.editFormData[item.prop];
        }
      });
      this.locationInfo = obj;
      this.showLocation = true;
    },
    //点击输入框去选择人员
    handleClickSelect() {},
    //选择组织人员
    goSeleteOrgMember(item, type) {
      if (item.disabled) {
        return false;
      }
      this.currentItem = item;
      let value = this.editFormData[item.prop] || "";
      let ids = this.editFormData[item.idsStr] || "";
      let outType = this.editFormData[item.outType] || "";

      let arr = value ? value.split(",") : [];
      let idsArr = ids ? ids.split(",") : [];
      let typeArr = outType ? outType.split(",") : [];

      let chosedData = [];
      let typePre = type.split("-")[0];
      let typeBre = type.split("-")[1];
      if (typeBre == "select") {
        typeBre = "";
      }
      if (typePre == "dept") {
        this.orgMemberSelect = {
          seleteType: typeBre ? typeBre : "org",
          radio: !item.multiple, //单选还是多选
          outOrg: item.isOutOrg === undefined ? "" : item.isOutOrg, //是否是外单位
          props: {
            label: "name",
            children: "children",
          },
          column: [
            {
              label: "组织",
              prop: "name",
            },
          ],
          chosedData: [],
        };

        arr.map((i, index) => {
          let obj = {};
          obj.id = idsArr[index];
          obj[this.orgMemberSelect.column[0].prop] = arr[index];
          chosedData.push(obj);
        });
      } else if (typePre == "user") {
        this.orgMemberSelect = {
          seleteType: typeBre ? typeBre : "orgmember",
          radio: !item.multiple, //单选还是多选
          outOrg: item.isOutOrg === undefined ? "" : item.isOutOrg, //是否是外单位
          props: {
            label: "name",
            children: "children",
          },
          column: [
            {
              label: "用户名",
              prop: "name",
            },
            {
              label: "账号",
              prop: "account",
            },
            {
              label: "所属组织",
              prop: "orgName",
            },
          ],
          chosedData: [],
        };

        let deptCode = item.deptCodeStr
          ? this.editFormData[item.deptCodeStr] || ""
          : ""; //部门code
        let deptName = item.deptStr
          ? this.editFormData[item.deptStr] || ""
          : ""; //部门名称
        let phone = item.phoneStr ? this.editFormData[item.phoneStr] || "" : ""; //手机号
        let deptCodeArr = deptCode ? deptCode.split(",") : [];
        let deptNameArr = deptName ? deptName.split(",") : [];
        let phoneArr = phone ? phone.split(",") : [];
        arr.map((i, index) => {
          let obj = {};
          obj.id = idsArr[index];

          obj.deptCode = deptCodeArr[index] || "";
          obj.deptName = deptNameArr[index] || "";
          obj.phone = phoneArr[index] || "";

          obj[this.orgMemberSelect.column[0].prop] = arr[index];
          chosedData.push(obj);
        });
      } else if (type == "deviceClassify") {
        //选设备分类
        this.orgMemberSelect = {
          seleteType: "deviceClassify",
          radio: !item.multiple,
          props: {
            label: "name",
            children: "children",
          },
          column: [
            {
              label: "分类名称",
              prop: "name",
            },
          ],
          chosedData: [],
        };

        arr.map((i, index) => {
          let obj = {};
          obj.id = idsArr[index];
          obj[this.orgMemberSelect.column[0].prop] = arr[index];
          chosedData.push(obj);
        });
      } else if (type == "device") {
        //选设备
        this.orgMemberSelect = {
          seleteType: "device",
          radio: !item.multiple,
          props: {
            label: "name",
            children: "children",
          },
          column: [
            {
              label: "设备名称",
              prop: "name",
            },
          ],
          chosedData: [],
        };
        arr.map((i, index) => {
          let obj = {};
          obj.id = idsArr[index];
          obj[this.orgMemberSelect.column[0].prop] = arr[index];
          chosedData.push(obj);
        });
      } else if (typePre == "majorEquipment") {
        //选主要设备类型
        this.majorEquipment = {
          radio: !item.multiple,
          equipmentId: idsArr[0],
          equipmentName: arr[0],
          deptManage: this.editFormData[item.deptManage] || "",
          deptManageName: this.editFormData[item.deptManageName] || "",
          equipmentType: this.editFormData[item.equipmentType] || "",
          disSearch: true,
          choseData: this.editFormData[item.choseData] || [],
        };
        this.showEquipment = true;
        return;
      } else if (typePre == "location") {
        //选位置
        this.orgMemberSelect = {
          seleteType: "location",
          radio: !item.multiple,
          props: {
            label: "name",
            children: "children",
          },
          column: [
            {
              label: "位置名称",
              prop: "name",
            },
          ],
          chosedData: [],
        };
        arr.map((i, index) => {
          let obj = {};
          obj.id = idsArr[index];
          obj[this.orgMemberSelect.column[0].prop] = arr[index];
          chosedData.push(obj);
        });
      }
      this.orgMemberSelect.chosedData = chosedData;
      this.dialogType = type;
      this.showMember = true;
    },
    //打开选人组件
    goSelectUser(item, type) {
      if (item.disabled) {
        return false;
      }
      let result = true;
      if (item.beforeMethod) {
        result = item.beforeMethod(this.editFormData, item);
      }
      if (result) {
        this.currentItem = item;
        let Names = this.editFormData[item.prop]
          ? Array.isArray(this.editFormData[item.prop])
            ? this.editFormData[item.prop]
            : this.editFormData[item.prop].split(",")
          : [];
        let Ids = this.editFormData[item.idsStr]
          ? Array.isArray(this.editFormData[item.idsStr])
            ? this.editFormData[item.idsStr]
            : this.editFormData[item.idsStr].split(",")
          : [];
        let orgNames = this.editFormData[item.orgNameStr]
          ? Array.isArray(this.editFormData[item.orgNameStr])
            ? this.editFormData[item.orgNameStr]
            : this.editFormData[item.orgNameStr].split(",")
          : [];
        let orgIds = this.editFormData[item.orgIdStr]
          ? Array.isArray(this.editFormData[item.orgIdStr])
            ? this.editFormData[item.orgIdStr]
            : this.editFormData[item.orgIdStr].split(",")
          : [];
        let orgStr = this.editFormData[item.orgStr]
          ? Array.isArray(this.editFormData[item.orgStr])
            ? this.editFormData[item.orgStr]
            : this.editFormData[item.orgStr].split(",")
          : [];
        let chosedData = [];
        if (
          [
            "device-select",
            "device",
            "line",
            "risk",
            "toolOrg",
            "toolOrg_dep",
          ].includes(type)
        ) {
          this.orgMemberSelect = {
            multiple: item.multiple === undefined ? false : item.multiple, //单选还是多选
            chosedData: [],
            defaultIds: item.defaultIds === undefined ? [] : item.defaultIds,
            filterConfig:
              item.filterConfig === undefined ? [] : item.filterConfig,
            managerUnit: item.managerUnit === undefined ? [] : item.managerUnit,
            standardType:
              item.standardType === undefined ? "" : item.standardType,
            onlyHighLine: item.onlyHighLine,
          };
          (type === "line" || type === "risk") &&
            (this.orgMemberSelect["highLine"] = true);
          Names.map((i, index) => {
            let obj = {};
            obj.id = Ids[index];
            obj.name = Names[index] || "";
            chosedData.push(obj);
          });
          this.orgMemberSelect.chosedData = chosedData;
          if (type === "risk") {
            this.showRisk = true;
          } else if (type === "toolOrg" || type === "toolOrg_dep") {
            // this.orgMemberSelect.type = type
            this.$set(this.orgMemberSelect, "type", type);
            this.showTool = true;
          } else {
            this.showDevice = true;
          }
        } else {
          this.orgMemberSelect = {
            type: type,
            multiple: item.multiple === undefined ? false : item.multiple, //单选还是多选
            outOrg: item.isOutOrg === undefined ? "" : item.isOutOrg, //是否是外单位
            chosedData: [],
            level: item.level === undefined ? null : item.level,
            defaultOrg: item.defaultOrg === undefined ? "" : item.defaultOrg,
            defaultIds: item.defaultIds === undefined ? [] : item.defaultIds,
            defaultJob: item.defaultJob === undefined ? null : item.defaultJob,
            permission: item.permission === undefined ? true : item.permission,
          };
          Names.map((i, index) => {
            let obj = {};
            obj.id = Ids[index];
            obj.name = Names[index] || "";
            obj.orgName = orgNames[index] || "";
            obj.orgId = orgIds[index] || "";
            obj.isOutOrg = orgStr[index];
            chosedData.push(obj);
          });
          this.orgMemberSelect.chosedData = chosedData;
          this.showUser = true;
        }
        this.dialogType = type;
      }
    },
    //确定选择人员
    newMemberSelect() {
      let data = this.$refs.newMember.getSelectData();
      //把数据同步到输入查询
      data.map((i) => {
        i.label = i.name;
        if (this.dialogType == "user-select") {
          let value = i.orgId ? i.orgId : "";
          i.value = i.id + value;
        } else {
          i.value = i.id;
        }
      });
      if (
        [
          "dept-select",
          "user-select",
          "location-select",
          "device-select",
          "userOnly-select",
        ].includes(this.dialogType)
      ) {
        this.setConfigArrOption(this.currentItem, data);
      }
      let names = "";
      let ids = "";
      let orgNames = "";
      let orgIds = "";
      let orgArr = "";
      let idsArr = [];
      if (data) {
        names = data.map((i) => i.name).join();
        ids = data
          .map((i) => {
            idsArr.push(i.value);
            return i.id;
          })
          .join();
        orgNames = data.map((i) => i.orgName).join();
        orgIds = data.map((i) => i.orgId).join();
        orgArr = data.map((i) => i.isOutOrg).join();
      }
      /* 避免赋值时，selectOption里面还没有值，导致页面显示编码 */
      setTimeout(() => {
        if (this.currentItem.propArr) {
          if (this.currentItem.multiple) {
            //多选
            this.setFormItem(this.currentItem.propArr, idsArr);
          } else {
            //单选
            setTimeout(() => {
              this.setFormItem(this.currentItem.propArr, idsArr[0]);
            }, 0);
          }
        }
        if (this.currentItem.idsStr) {
          this.$set(this.editFormData, this.currentItem.idsStr, ids);
        }
        if (this.currentItem.orgNameStr) {
          this.$set(this.editFormData, this.currentItem.orgNameStr, orgNames);
        }
        if (this.currentItem.orgIdStr) {
          this.$set(this.editFormData, this.currentItem.orgIdStr, orgIds);
        }
        if (this.currentItem.orgStr) {
          this.$set(this.editFormData, this.currentItem.orgStr, orgArr);
        }
        this.$set(this.editFormData, this.currentItem.prop, names);
        this.showUser = false;
        this.showDevice = false;
        this.showRisk = false;
        this.showTool = false;
        if (this.currentItem.methods) {
          this.currentItem.methods(data, this.editFormData);
        }
      }, 200);
    },
    getListDialogItem(item, type) {
      /* 回显已选中的数据 */
      this.selectId = [];
      if (item.option?.length > 0) {
        item.option.map((i) => {
          this.selectId.push(i.value);
        });
      }
      //选工作票
      if (type == "workTicket") {
        this.listContent = workTicket;
        this.showList = true;
        this.listContentProp = item.prop;
        this.dialogItem = item;
        //设置多选
        item.multiple &&
          this.$nextTick(() => {
            /* 回显已选中的数据 */
            item.option?.length && (this.selectId = [...item.option[0].id]);
            this.$refs.listDialog.setCheckbox();
          });
        // 设置单选
        !item.multiple &&
          this.$nextTick(() => {
            /* 回显已选中的数据 */
            item.option?.length && (this.selectId = [item.option[0].id]);
            this.$refs.listDialog.setRadio();
          });
      } else if (type == "defectKeyWord") {
        this.listContent = defectLibrary;
        this.showList = true;
        this.listContentProp = item.prop;
        this.dialogItem = item;
      }
    },
    async setListDialogItem() {
      let data = {};
      if (this.dialogItem.type == "defectKeyWord") {
        data = await this.$refs.listDialog.getSelectData();
        data.label = data.keyword;
        data.value = data.id;

        //this.setConfigArrOption(this.dialogItem, [data]);
        this.setFormItem(this.dialogItem.prop, data.keyword);
        //this.setFormItem(this.dialogItem.propArr, data.id);
        this.setFormItem(this.dialogItem.idsStr, data.id);
        // if (this.dialogItem.methods) {
        //   this.dialogItem.methods(data,this.editFormData);
        // }
      } else if (
        this.dialogItem.type == "vehicle" ||
        this.dialogItem.type == "driver"
      ) {
        data = this.$refs.listDialog.getVehicleSelectData();
        data.label =
          this.dialogItem.type == "vehicle"
            ? data.licPlateNum
            : data.driverName;
        data.value = data.id;
        //this.setConfigArrOption(this.dialogItem, [data]);
        this.setFormItem(this.dialogItem.prop, data.label);
        //this.setFormItem(this.dialogItem.propArr, data.id);
        this.setFormItem(this.dialogItem.idsStr, data.value);
      } else if (this.dialogItem.type == "apply-code") {
        data = this.$refs.listDialog.getCodeSelectData();
        data.label = data.code;
        data.value = data.id;
        this.setFormItem(this.dialogItem.prop, data.label);
        this.setFormItem(this.dialogItem.idsStr, data.value);
      } else {
        data = this.$refs.listDialog.getSeleteData();
        this.setFormItem(this.listContentProp, data.code);
        this.setConfigArrOption(this.dialogItem, [data]);
      }
      this.showList = false;
      this.dialogItem.methods &&
        this.dialogItem.methods(data, this.editFormData);
    },
    //确定选择
    addSeleteMember() {
      let data = this.$refs.orgMemberSelect.getSeleteData();
      //把数据同步到输入查询
      data.map((i) => {
        i.label = i.name;
        i.value = i.id;
      });
      if (
        [
          "dept-select",
          "user-select",
          "location-select",
          "userOnly-select",
        ].includes(this.dialogType)
      ) {
        this.setConfigArrOption(this.currentItem, data);
      }
      let names = "";
      let ids = "";
      let accounts = "";
      let idsArr = [];
      let orgArr = [];
      if (data) {
        names = data
          .map((i) => {
            return i[this.orgMemberSelect.column[0].prop];
          })
          .join();
        ids = data
          .map((i) => {
            idsArr.push(i.id);
            orgArr.push({
              orgId: i.orgId,
              orgName: i.orgName,
            });
            return i.id;
          })
          .join();
        accounts = data
          .map((i) => {
            return i.account;
          })
          .join();
      }
      setTimeout(() => {
        if (this.currentItem.propArr) {
          if (this.currentItem.multiple) {
            //多选
            this.setFormItem(this.currentItem.propArr, idsArr);
          } else {
            //单选
            this.setFormItem(this.currentItem.propArr, idsArr[0]);
          }
        }
      }, 0);
      if (this.currentItem.idsStr) {
        this.$set(this.editFormData, this.currentItem.idsStr, ids);
      }
      if (this.currentItem.account) {
        this.$set(this.editFormData, this.currentItem.account, accounts);
      }
      if (this.currentItem.orgArr) {
        this.$set(this.editFormData, this.currentItem.orgArr, orgArr);
      }
      this.$set(this.editFormData, this.currentItem.prop, names);
      this.showMember = false;
      if (this.currentItem.methods) {
        this.currentItem.methods(data, this.editFormData);
      }
    },
    seleteEquipment() {
      let data = this.$refs.majorEquipment.getSeleteData();
      if (this.majorEquipment.radio) {
        this.$set(this.editFormData, this.currentItem.idsStr, data.equipmentId);
        this.$set(this.editFormData, this.currentItem.prop, data.equipmentName);
        if (this.currentItem.equipmentType) {
          this.$set(
            this.editFormData,
            this.currentItem.equipmentType,
            data.equipmentType
          );
        }
        this.$set(
          this.editFormData,
          this.currentItem.deptManage,
          data.deptManage
        );
        this.$set(
          this.editFormData,
          this.currentItem.deptManageName,
          data.deptManageName
        );
      } else {
        let nameStr = "";
        if (data.length) {
          nameStr = data[0].equipmentName;
          for (let i = 1; i < data.length; i++) {
            nameStr = nameStr + "," + data[i].equipmentName;
          }
        }
        this.$set(this.editFormData, this.currentItem.choseData, data);
        this.$set(this.editFormData, this.currentItem.prop, nameStr);
      }
      this.showEquipment = false;
      if (this.currentItem.methods) {
        this.currentItem.methods(data, this.editFormData);
      }
    },
    //选项框消失后就只保留已选中的选项
    async clearOther(val, item) {
      if (!val) {
        //选项框消失时
        //当前已选中的所有项
        let propArr = this.editFormData[item.propArr] || [];
        //多选时数组propArr为数组
        let option = item.option;
        let selectItem = [];
        option.map((i) => {
          if (propArr.includes(i.value)) {
            selectItem.push(i);
          }
        });
        let config = this.editFormConfig.itemArr;
        for (let k in config) {
          if (config[k].prop == item.prop) {
            //找到相应的项
            //
            config[k].option = selectItem;
            break;
          }
        }
        this.count = 1;
        // //调用自定义的方法
        // if (item.methods) {
        //   item.methods(selectItem || {});
        // }
      }
      if (val && item.type == "equipmentBrand") {
        let form = {
          page: 1,
          pageSize: 20,
        };
        this.selectLoading = true;
        let res = await brandStockList(form);
        let data = res.data.records || [];
        data.map((i) => {
          i.label = i.name;
          i.value = i.id;
        });
        this.setConfigArrOption(item, data);
        this.count = 1;
        this.selectLoading = false;
      }
    },
    //可输入查询人员组织，查询人员和组织的数据
    async getSelectOption(query, item) {
      if (query !== "") {
        let typePre = item.type.split("-")[0];
        let form = {
          name: query,
          level: item.level === undefined ? null : item.level, //查询组织的时候用
          permission: true,
        };
        if (item.type == "dept-select") {
          form.outOrg = item.isOutOrg === undefined ? "" : item.isOutOrg; //是否是外单位
        } else if (item.type == "user-select") {
          form.isOutOrg = item.isOutOrg === undefined ? "" : item.isOutOrg; //是否是外单位
        }
        this.query = query;
        let actionApi = null;
        if (typePre == "dept") {
          actionApi = getOrgList;
        } else if (typePre == "user") {
          if (item.defaultJob != undefined) {
            form.postName = item.defaultJob;
          }
          actionApi = queryUserList;
        } else if (typePre == "userOnly") {
          actionApi = getUserDataByOrg;
        } else if (typePre == "location") {
          //暂时没有要求要输入选择
          form.status = "enabled";
          actionApi = getlocationList;
        } else if (typePre == "device") {
          form.page = 1;
          form.pageSize = 20;
          if (item.filterConfig && item.filterConfig.length > 0) {
            form.configRules = item.filterConfig.join();
          }
          if (item.managerUnit && item.managerUnit.length > 0) {
            form.managerUnits = item.managerUnit.join();
          }
          if (item.standardType && item.standardType != "") {
            form.standardType = item.standardType;
          }
          actionApi = queryList;
        }
        let res = await actionApi(form);
        let data;
        if (typePre == "device" || typePre == "location") {
          data = res.data.list || [];
        } else {
          data = res.data || [];
        }
        data.map((i) => {
          i.label = i.name;
          let value = i.orgId ? i.orgId : "";
          i.value = i.id + value;
        });
        //是否可自创条目;query.match(/^[ ]*$/)判断是否是空格组成的
        if (item.allowCreate && !query.match(/^[ ]*$/)) {
          let addItem = {
            label: query,
            value: query,
            id: query,
            orgName: "",
            orgId: "",
            isOutOrg: "-1",
          };
          data.push(addItem);
        }
        this.selectOption = data;
        this.setConfigArrOption(item, data);
      }
    },
    //设备列表懒加载
    async equipmentLoad(item) {
      if (item.type == "device-select") {
        let form = {
          name: this.query,
          page: (this.count += 1),
          pageSize: 20,
        };
        let res = await queryList(form);
        let data = res.data.list || [];
        data.map((i) => {
          i.label = i.name;
          i.value = i.id;
        });
        let propArr = this.editFormData[item.propArr] || [];
        let option = [];
        data.map((i) => {
          if (!propArr.includes(i.value)) {
            //去掉已有项
            option.push(i);
          }
        });
        item.option = item.option.concat(option);
      }
    },
    //设备品牌库列表查询
    async getEquipmentBrand(query, item) {
      this.query = query;
      if (query !== "") {
        let form = {
          keyword: query,
          page: 1,
          pageSize: 20,
        };
        let res = await brandStockList(form);
        let data = res.data.records || [];
        data.map((i) => {
          i.label = i.name;
          i.value = i.id;
        });
        let filter = data.find((item) => item.name == query);
        //是否可自创条目;query.match(/^[ ]*$/)判断是否是空格组成的
        if (!query.match(/^[ ]*$/) && filter == undefined) {
          let addItem = {
            label: query,
            value: query,
            id: "",
            factoryName: query,
            name: query,
          };
          data.unshift(addItem);
        }
        this.setConfigArrOption(item, data);
      }
    },
    //品牌库下拉选择回传
    async brandSelectChange(val, item) {
      this.$forceUpdate();
      let ops = item.option;
      let obj = ops.find((i) => i.value == val);
      let isCreat = false;
      if (obj.id == "") {
        isCreat = true;
        let res = await brandStockAdd(obj);
        obj.value = res.data;
        obj.id = res.data;
        item.option[0] = obj;
        this.setFormItem(item.prop, obj.label);
        this.setFormItem(item.idsStr, [obj.id]);
        setTimeout(() => {
          this.setFormItem(item.propArr, obj.id); //单选不能多选
        });
      }
      await brandStockNumPlus({ id: obj.value });
      this.option = [obj];
      this.query = "";
      //基础选择器
      if (item.methods) {
        item.methods(obj || {}, this.editFormData);
      }
    },
    //品牌库懒加载
    async load(item) {
      let form = {
        keyword: this.query,
        page: (this.count += 1),
        pageSize: 20,
      };
      let res = await brandStockList(form);
      let data = res.data.records || [];
      data.map((i) => {
        i.label = i.name;
        i.value = i.id;
      });
      let propArr = this.editFormData[item.propArr] || [];
      let option = [];
      data.map((i) => {
        if (!propArr.includes(i.value)) {
          //去掉已有项
          option.push(i);
        }
      });
      item.option = item.option.concat(option);
    },
    // //缺陷库列表查询
    // async getDefectList(query, item) {
    //   this.query = query;
    //   if (query !== "") {
    //     let form = {
    //       keyword: query,
    //       status: 1,
    //     };
    //     this.selectLoading = true;
    //     let res = await queryDefectList(form);
    //     let data = res.data.records || [];
    //     data.map((i) => {
    //       i.label = i.keyword;
    //       i.value = i.id;
    //     });
    //     let filter = data.find((item) => item.name == query);
    //     //是否可自创条目;query.match(/^[ ]*$/)判断是否是空格组成的
    //     // if (!query.match(/^[ ]*$/) && filter == undefined) {
    //     //   let addItem = {
    //     //     label: query,
    //     //     value: query,
    //     //     id: "",
    //     //     keyword: query,
    //     //     status: 1,
    //     //   };
    //     //   data.push(addItem);
    //     // }
    //     this.setConfigArrOption(item, data);
    //     this.selectLoading = false;
    //   }
    // },
    //缺陷库下拉选择回传
    // async defectSelectChange(val, item) {
    //   if (val) {
    //     this.$forceUpdate();
    //     let ops = item.option;
    //     let obj = ops.find((i) => i.value == val);
    //     // if (obj.id == "") {
    //     //   let params = JSON.parse(JSON.stringify(obj));
    //     //   delete params.id;
    //     //   let res = await saveDefect(params);
    //     //   obj.value = res.data;
    //     //   obj.id = res.data;
    //     // }
    //     // item.option[0] = obj;
    //     this.setFormItem(item.prop, obj.label);
    //     this.setFormItem(item.idsStr, obj.id);
    //     setTimeout(() => {
    //       this.setFormItem(item.propArr, obj.id);
    //     }, 0);
    //     await DefectRefPlus({ id: obj.value });
    //     //基础选择器
    //     if (item.methods) {
    //       item.methods(obj, this.editFormData);
    //     }
    //   } else {
    //     if (item.methods) {
    //       item.methods({}, this.editFormData);
    //     }
    //   }
    // },
    //设置选人选组织的预选项
    setConfigArrOption(item, data) {
      let oldOption = item.option || [];
      //当前已选中的所有项
      let propArr = this.editFormData[item.propArr] || [];
      //已选择的项
      let selectOption = [];
      oldOption.map((i) => {
        if (propArr.includes(i.value)) {
          selectOption.push(i);
        }
      });
      let option = [];
      data.map((i) => {
        if (!propArr.includes(i.value)) {
          //去掉已有项
          option.push(i);
        }
      });
      //将搜索结果跟已选中的项数据合并
      //option = selectOption.concat(option);
      // positiveSequence 为真则正序，为假则逆序(默认逆序)
      option = this.positiveSequence
        ? selectOption.concat(option)
        : option.concat(selectOption);
      let config = this.editFormConfig.itemArr;
      for (let k in config) {
        if (config[k].prop == item.prop) {
          //找到相应的项
          config[k].option = option;
          break;
        }
      }
    },
    setItemOption(prop, data) {
      let config = [];
      //深度拷贝数组对象(可拷贝函数)
      $.extend(true, config, this.editFormConfig.itemArr);
      let propArr = [];
      for (let k in config) {
        if (config[k].prop == prop) {
          //找到相应的项
          config[k].option = data;
          if (config[k].multiple) {
            let propArr = config[k].propArr;
            //多选
            let valueArr = [];
            data.map((i) => {
              valueArr.push(i.value);
            });
            this.editFormData[propArr] = valueArr;
          }
          break;
        }
      }
      this.editFormConfig.itemArr = config;
    },

    //设置autocomplete的option，设置（输入查询的备选项）
    setAutocompleteOption(prop, data) {
      let config = this.editFormConfig.itemArr;
      for (let k in config) {
        if (config[k].prop == prop) {
          //找到相应的项
          config[k].selectOption = data;
          break;
        }
      }
    },
    //设置表单某栏位内容
    setFormItem(prop, data) {
      this.$set(this.editFormData, prop, data);
    },
    //设置表单的数据项
    setItemConfig(prop, data, name) {
      let config = [];
      //深度拷贝数组对象(可拷贝函数)
      $.extend(true, config, this.editFormConfig.itemArr);
      for (let k in config) {
        if (config[k].prop == prop) {
          //找到相应的项
          config[k][name] = data;
          break;
        }
      }
      this.editFormConfig.itemArr = config;
    },
    //获取表单某栏位内容
    getFormItem(prop) {
      return this.editFormData[prop];
    },
    //搜索下拉框选择时回传
    searchSelectChange(val, item) {
      if (item.methods) {
        let ops = item.seleteOption;
        if (item.multiple === true) {
          let arr = ops.filter((i) => val.indexOf(i.value) > -1);
          item.methods(arr, this.editFormData);
        } else {
          let obj = ops.find((i) => i.value == val);
          item.methods(obj, this.editFormData);
        }
      }
    },
    //下拉框选择时回传
    selectChange(val, item) {
      this.$forceUpdate();
      //基础选择器
      if (item.type == "select") {
        if (item.methods) {
          let ops = item.selectOption;
          if (item.multiple === true) {
            let arr = ops.filter((i) => val.indexOf(i.value) > -1);
            item.methods(arr, this.editFormData);
          } else {
            let obj = ops.find((i) => i.value == val);
            item.methods(obj || {}, this.editFormData);
          }
        }
      } else if (
        [
          "dept-select",
          "user-select",
          "device-select",
          "location-select",
          "userOnly-select",
        ].includes(item.type) &&
        !item.multiple
      ) {
        //选组织、选人单选,与点击按钮选择之间同步数据
        let propArr = this.editFormData[item.propArr];
        let option = item.option;
        let selectItem = {};
        let isExist = false;
        for (let i in option) {
          if (propArr == option[i].value) {
            selectItem = option[i];
            isExist = true;
            break;
          }
        }
        if (isExist) {
          //存在，即非自创条目
          this.setFormItem(item.prop, selectItem.label);
          this.setFormItem(item.idsStr, selectItem.id);
          this.setFormItem(item.orgNameStr, selectItem.orgName);
          this.setFormItem(item.orgIdStr, selectItem.orgId);
          this.setFormItem(item.orgStr, selectItem.isOutOrg);
        } else {
          //不存在，即自创条目
          this.setFormItem(item.prop, val);
          this.setFormItem(item.idsStr, val);
          this.setFormItem(item.orgNameStr, "");
          this.setFormItem(item.orgIdStr, "");
          this.setFormItem(item.orgStr, "-1");
        }
        //调用自定义的方法
        if (item.methods) {
          item.methods([selectItem] || {}, this.editFormData);
        }
      } else if (
        [
          "dept-select",
          "user-select",
          "device-select",
          "location-select",
          "userOnly-select",
        ].includes(item.type) &&
        item.multiple
      ) {
        //选组织、选人多选,与点击按钮选择之间同步数据
        //当前已选中的所有项
        let propArr = this.editFormData[item.propArr] || [];
        let str = propArr.toString();
        //最后一次点击的项
        let selectItem = propArr[propArr.length - 1];
        //多选时数组propArr为数组
        let option = item.option;
        //是否是用户自创条目
        let isCreatItem = true;
        //判断是否是用户创建的条目
        for (let i in option) {
          if (option[i].value == selectItem) {
            isCreatItem = false;
            break;
          }
        }
        //如果是用户自创的条目要把它加入Option里面
        if (isCreatItem) {
          let item = {
            label: selectItem,
            value: selectItem,
            id: selectItem,
            orgName: "",
            orgId: "",
            isOutOrg: "-1",
          };
          option.push(item);
        }
        //所有选中的名字
        let nameArr = [];
        let idArr = [];
        let orgArr = [];
        let orgNameArr = [];
        let orgIdArr = [];
        let selectItemArr = [];
        //备选项里是否含有当前选中的值，可以以此来判断是否是用户新建的条目
        option.map((i) => {
          if (propArr.includes(i.value)) {
            nameArr.push(i.label);
            idArr.push(i.id);
            orgArr.push(i.isOutOrg);
            orgNameArr.push(i.orgName);
            orgIdArr.push(i.orgId);
            selectItemArr.push(i);
          }
        });
        this.setFormItem(item.prop, nameArr.toString());
        this.setFormItem(item.idsStr, idArr.toString());
        this.setFormItem(item.orgNameStr, orgNameArr.toString());
        this.setFormItem(item.orgIdStr, orgIdArr.toString());
        this.setFormItem(item.orgStr, orgArr.toString());
        //调用自定义的方法
        if (item.methods) {
          item.methods(selectItemArr || [], this.editFormData);
        }
        this.$refs.selectItem.forEach((item) => {
          item.query = "";
        });
        this.$emit("selectChange");
      }
    },
    //单选框选择时回传
    radioChange(val, item) {
      if (item.methods) {
        let ops = item.radioOption;
        let obj = ops.find((i) => i.value == val);
        item.methods(obj || {}, this.editFormData);
      }
    },
    //区块选择时触发
    selectCascaderChange(val, item) {
      if (item.methods) {
        let ops = this.cascaderOp[item.type] || item.selectOption;
        let allList = this.$utils.convert_tree_data(ops);
        let arr = allList.filter((i) => val.includes(i.value));
        item.methods(arr, this.editFormData);
      }
    },
    //值改变事件（除下拉框）
    inputChange(val, item) {
      if (item.methods) {
        item.methods(val, this.editFormData);
      }
    },
    //文件改变时
    changeFilesField(filesObj, item) {
      this.editFormData[item.fileField] = filesObj;
      let len = filesObj.files.length;
      if (len) {
        this.$set(this.editFormData, item.prop, ["ok"]);
      } else {
        this.$set(this.editFormData, item.prop, []);
      }
    },
    //输入框搜索输入时触发
    querySearchAsync(item) {
      return (queryString, cb) => {
        var restaurants = item.selectOption.map((i) => {
          return { ...i };
        });
        var results = queryString
          ? restaurants.filter(this.createStateFilter(queryString))
          : restaurants;

        clearTimeout(this.timeout);
        this.timeout = setTimeout(() => {
          cb(results);
        }, 500 * Math.random());
      };
    },
    orgComClear(item) {
      this.$set(this.editFormData, item.prop, "");
      this.$set(this.editFormData, item.idsStr, "");
      this.$set(this.editFormData, item.orgStr, "");
    },
    //多选人和组织时移除项
    removeTag(val, item) {
      let value = this.editFormData[item.prop];
      let ids = this.editFormData[item.idsStr];
      let orgStr = this.editFormData[item.orgStr];
      let arr = value ? value.split(",") : [];
      let idsArr = ids ? ids.split(",") : [];
      let orgArr = orgStr ? orgStr.split(",") : [];

      let newArr = [];
      let newidsArr = [];
      let newOrg = [];
      let removeNum = null; //移除项的位置
      let removeName = ""; //移除项的名字
      //找移除的项
      idsArr.map((i, index) => {
        if (i != val) {
          newidsArr.push(i);
        } else {
          removeNum = index;
        }
      });
      //移除的项是否含有ID，即是不是自创条目
      if (removeNum == null) {
        //是自创条目
        removeName = val;
      }
      arr.map((i, index) => {
        if (index != removeNum && i != removeName) {
          newArr.push(i);
        }
      });
      orgArr.map((i, index) => {
        if (index != removeNum) {
          newOrg.push(i);
        }
      });
      this.editFormData[item.prop] = newArr.toString();
      this.editFormData[item.idsStr] = newidsArr.toString();
      this.editFormData[item.orgStr] = newOrg.toString();
    },
    createStateFilter(queryString) {
      return (state) => {
        return (
          state.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1
        );
      };
    },
    //选择输入框备选项
    handleSelectAuto(obj, item) {
      if (item.selectMethods) {
        item.selectMethods(obj);
      }
    },
    //输入时触发
    changeAuto(val, item) {
      if (item.changeMethods) {
        item.changeMethods(val);
      }
    },
  },
};
</script>

<style lang="less">
.edit-form-box {
  .disShow {
    display: none;
  }
  .special {
    .el-form-item__label {
      line-height: 24px;
      padding: 6px 12px 0 0;
    }
  }
  .disVisibility {
    visibility: hidden;
  }
  .h40 {
    min-height: 40px;
  }
  .el-radio-group {
    text-align: left;
  }
  .sign {
    position: relative;
    bottom: 1px;
    width: 70px;
    height: 33px;
    line-height: 0;
    color: #e6a23c !important;
    background: #fdf6ec !important;
    border: 1px #faecd8 solid !important;
  }
  .signed {
    position: relative;
    bottom: 1px;
    width: 70px;
    height: 33px;
    line-height: 0;
    color: #67c23a !important;
    background: #f0f9eb !important;
    border: 1px #e1f3d8 solid !important;
  }
  .input-button-type {
    position: relative;
    bottom: 1px;
    width: 70px;
    height: 33px;
    line-height: 0;
    color: #0d60b4 !important;
    background: #f8f8f8 !important;
    border: 1px #cccccc solid !important;
  }
  .otherInfoDiv {
    margin-bottom: 10px;
  }
}
.multipleDiv {
  .selectBtn {
    top: 0px !important;
  }
  .line1,
  .lineundefined {
    height: 40px !important;
    .el-select .el-input__inner,
    .selectBtn {
      height: 32px !important;
    }
    .el-select .el-input__inner {
      max-height: 32px !important;
    }
    .el-select {
      line-height: 32px;
    }
    .selectBtn {
      // top: 1px !important;
    }
  }
  .line2 {
    height: 52px !important;
    .el-select .el-input__inner,
    .selectBtn {
      height: 52px !important;
    }
    .el-select .el-input__inner {
      max-height: 52px !important;
    }
  }
  .line3 {
    height: 76px !important;
    .el-select,
    .el-select > .el-input,
    .el-select .el-input__inner,
    .selectBtn {
      height: 76px !important;
    }
    .el-select .el-input__inner {
      max-height: 76px !important;
    }
  }
  .line4 {
    height: 100px !important;
    .el-select,
    .el-select > .el-input,
    .el-select .el-input__inner,
    .selectBtn {
      height: 100px !important;
    }
    .el-select .el-input__inner {
      max-height: 100px !important;
    }
  }
  .line5 {
    height: 122px !important;
    .el-select,
    .el-select > .el-input,
    .el-select .el-input__inner,
    .selectBtn {
      height: 122px !important;
    }
    .el-select .el-input__inner {
      max-height: 122px !important;
    }
  }
}
.selectDiv {
  // position: absolute;
  height: 40px;
  // display: flex;
  // align-items: center;
  // padding: 6px 0px;
  // line-height: 40px;
}
.selectContent {
  // height: 28px;
  // margin: 5px 0px;
  display: flex;
  flex-flow: wrap nowrap;
  align-items: center;
  width: 100%;
  .el-input__suffix {
    right: 5px;
    top: -5px;
  }
  // border: 1px solid #e1e1e1;
  .el-select .el-input__inner {
    height: 32px;
  }
  .el-select {
    // height: 28px;
    width: calc(100% - 36px);
  }
  .el-button {
    // border: none;
  }
  ::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 5px; /*高宽分别对应横竖滚动条的尺寸*/
    // height: 3px;
  }
  .el-select-dropdown.is-multiple .el-select-dropdown__item.selected::after {
    right: 10px;
  }
  .edit-form-box .el-form-item__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 24px !important;
    padding: 6px 12px 0 0;
  }
  .el-input--suffix .el-input__inner {
    padding-right: 20px;
  }
  .el-select .el-input .el-select__caret {
    width: 20px;
  }
  .el-select .el-select__tags {
    max-width: calc(100% - 20px) !important;
  }
}
.pathName {
  width: 100%;
  font-size: 12px;
}
.changeData {
  .el-input__inner,
  .el-textarea__inner,
  .el-tag.el-tag--info,
  .el-radio__input.is-checked + .el-radio__label,
  .el-select .el-input.is-disabled .el-input__inner,
  .el-textarea.is-disabled .el-textarea__inner,
  .el-input.is-disabled .el-input__inner,
  .el-radio__input.is-disabled + span.el-radio__label {
    color: rgb(235, 1, 1);
  }
}
.selectContent .el-select .el-input__inner {
  // position: relative;
  // z-index: 999;
}
.itemConten {
  display: flex;
  flex-flow: column nowrap;
  .itemConten-item {
    //height: 25px;
    line-height: 25px;
  }
  .itemConten-bottom {
    padding-left: 20px;
    color: #979797;
  }
}
.userSelect .el-select-dropdown__item {
  padding-left: 10px;
  padding-right: 30px;
  //height: 50px;
  height: auto;
  min-height: 30px;
}
.el-form-item__error {
  padding-top: 2px;
}
.textRed.el-input.is-disabled .el-input__inner {
  color: #ef4c4c;
}
.textRed.el-select .el-input.is-disabled .el-input__inner {
  color: #ef4c4c;
}
.textRed .el-radio__input.is-disabled + span.el-radio__label {
  color: #ef4c4c;
}
.el-select .el-input__inner {
  min-height: 32px !important;
}
.el-textarea__inner {
  font-weight: 450;
}
.el-range-input {
  font-weight: 450;
}
.el-input__inner {
  font-weight: 450;
}
.dayInput {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .location {
    font-size: 20px;
    color: #00468e;
    cursor: pointer;
  }
}
.address {
  margin: 2px 0;
  cursor: pointer;
}
</style>
